package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum NoticeType {
	
	BASE(0,"系统公告"),
	SHOP(1,"门店公告"),
	CITY(2,"城市运营公告");
	
	private Integer value;
	private String text;

	private NoticeType(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static NoticeType toStatus(Integer value) {
		if (BASE.value == value) {
			return BASE;
		} else if (SHOP.value == value) {
			return SHOP;
		} else if (CITY.value == value) {
			return CITY;
		}else {
			throw new InvalidArgumentException("Unknown OrderStatus[" + value + "].");
		}
	}
}
